package com.way.Java多线程编程核心技术v2.chapter02_对象及变量的并发访问._2_1_synchronized同步方法.将synchronized方法与对象作为锁;

/**
 * @PROJECT_NAME: my-projects
 * @DESCRIPTION:
 * @USER: 魏彪
 * @DATE: 2023/11/28 15:48
 */
public class Test02 {
    public static void main(String[] args) {
        MyObject01 object01 = new MyObject01();

        ThreadC c = new ThreadC(object01);
        c.setName("C");

        ThreadD d = new ThreadD(object01);
        d.setName("D");

        c.start();
        d.start();
    }
}
